#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t;

bool cmp(const char& a,const char& b){
	return a>b;
}
void solve(){
	string s;
	cin>>s;
	sort(s.begin(),s.end(),cmp);
	cout<<s<<endl;

}
int main(){
	cin>>t;
	while(t--){
		solve();
	}	
	
	return 0;
}
